package day.day06;

import java.util.Random;
import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        Random rand = new Random();
        int number = rand.nextInt(100);
        System.out.println(number);

        while (true){
            Scanner sc = new Scanner(System.in);
            System.out.println("猜吧");
            int guess = sc.nextInt();
            if(guess > number){
                System.out.println("猜大了");
            }
            else if(guess < number){
                System.out.println("猜小了");
            }
            else{
                System.out.println("猜对了");
                break;
            }

        }
    }

}
